package plantshop.controller.moves;

import java.io.Serializable;

import plantshop.model.Game;
import plantshop.model.plants.Plant;

public class PlantReplaceMove extends PlayerMove implements Serializable{
	private static final long serialVersionUID = 5633683828628464122L;
	private int disp, loc;
	private Plant p;
	
	
	public PlantReplaceMove(int disp, int loc, Plant p){
		this.disp = disp;
		this.loc = loc;
		this.p = p;
	}
	
	@Override
	public void execute(Game game) {
		game.getStore().removePlant(false, disp, loc);
		game.getStore().addPlant(false,disp, loc, p);
		p.setTakenOver(true);
	}
	
}
